const Router = require("koa-router");
const { Auth } = require("@middlewares/auth");
const { Notice } = require("@models/notice");
const router = new Router({
  prefix: "/v1/notice",
});

router.post("/", async (ctx, next) => {
  const where = {
    is_on: true,
  };
  const { count: total, rows } = await Notice.findAndCountAll({ where });
  ctx.body = {
    code: 200,
    msg: "success",
    data: rows[0],
  };
});

module.exports = router;
